#include <stdio.h>

static int sum_of_digits(int n)
{
    int sum = 0;
    while (n)
    {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}

int main()
{
    int a, b;
    scanf("%d %d", &a, &b);
    printf("%d\n", sum_of_digits(a) * sum_of_digits(b));
    return 0;
}
